import request from '@/utils/request/index.js'

export default {
  authLogin(data) {
    return request({
      url: '/store/mini/account/login',
      method: 'POST',
      data
    })
  },
  getInfo(data) {
    return request({
      url: '/store/mini/account/getInfo',
      method: 'POST',
      data
    })
  },
  bindMobile(data) {
    return request({
      url: '/store/mini/account/bindMobile',
      method: 'POST',
      data
    })
  },
  addAddress(data) {
    return request({
      url: '/store/mini/address/add',
      method: 'POST',
      data
    })
  },
  queryLocation(data) {
    return request({
      url: '/store/mini/area/location',
      method: 'GET',
      data
    })
  },
  // 获取买家收货地址
  queryUserAddress(data) {
    return request({
      url: '/store/mini/address',
      method: 'GET',
      data
    })
  },
  // 获取卖家收货地址列表
  getSellerAddress(){
    return request({
      url: '/store/mini/address/address/getSellerAddress',
      method: 'GET'
    })
  },
  deleteAddress(data) {
    return request({
      url: '/store/mini/address/delete',
      method: 'GET',
      data
    })
  },
  editAddress(data) {
    return request({
      url: '/store/mini/address/edit',
      method: 'POST',
      data
    })
  },
  defaultAddress(data) { // 获取默认地址
    return request({
      url: '/store/mini/address/address/default',
      method: 'GET',
      data
    })
  },
  // 获取卖家默认地址
  getSellerDefault(){
    return request({
      url: '/store/mini/address/address/sellerDefault',
      method: 'GET'
    })
  },
  getOthersInfo(data) { // 他人或者自己的主页查询自己的传空对象
    return request({
      url: '/store/mini/account/getOthersInfo',
      method: 'POST',
      data
    })
  },
  updateMyInfo(data) { // 个人信息-修改
    return request({
      url: '/store/mini/account/updateMyInfo',
      method: 'POST',
      data
    })
  },
  getRelation(data) { // 邀请页面查询是否已经绑定关系
    return request({
      url: '/store/mini/head/getRelation',
      method: 'POST',
      data
    })
  },
  updateHelpSellExamine(data) { // 修改是否开启帮卖
    return request({
      url: '/store/mini/userSet/updateHelpSellExamine',
      method: 'POST',
      data
    })
  },
  // 帮卖设置
  updateHelpSellRatio(data) {
    return request({
      url: '/store/mini/userSet/updateSubordinateHelpSellCommissionRatio',
      method: 'POST',
      data
    })
  },
  // 推荐奖金配置
  getBonusInfo() {
    return request({
      url: '/store/mini/userSet/getRecommendBonusInfo',
      method: 'POST',
    })
  },
  // 修改推荐奖金配置
  setReBonus(data) {
    return request({
      url: '/store/mini/userSet/setRecommendBonus',
      method: 'POST',
      data
    })
  },
  // 商家后台登录确认
  sellerLogin(data) {
    return request({
      url: '/store/mini/account/confirmSellerLogin',
      method: 'POST',
      data
    })
  },
}